package de.bazinga.rotw.input;

import com.jme.input.InputHandler;
import com.jme.input.RelativeMouse;
import com.jme.math.Vector3f;
import com.jme.renderer.Camera;

public class LockedMouseLookHandler extends InputHandler {

    private LockedMouseLook mouseLook;

    public LockedMouseLookHandler( Camera cam, float speed ) {
        RelativeMouse mouse = new RelativeMouse("Mouse Input");
        mouse.registerWithInputHandler( this );

        mouseLook = new LockedMouseLook(mouse, cam, speed );
        mouseLook.setLockAxis(new Vector3f(cam.getUp()));
        addAction(mouseLook);
    }
    
    public void requireButtonPress(boolean value) {
        mouseLook.setButtonPressRequired(value);
    }
    
    public void setLockAxis(Vector3f lock) {
        mouseLook.setLockAxis(new Vector3f(lock));
    }
    
    public LockedMouseLook getMouseLook() {
        return mouseLook;
    }
}